package main

func main() {
	ch := make(chan string)
	go func() {
		ch <- "go"
		ch <- "hello"
		ch <- "world"

		//如果是 nil 信道，循环将永远阻塞。fatal error: all goroutines are asleep - deadlock!
		//最后一定要关闭
		close(ch)
	}()

	for s := range ch {
		println(s)
	}
}
